<!DOCTYPE HTML>
<html>
<head>
<title>后台登陆</title>
<!-- Custom Theme files -->
<link href="css/istyle.css" rel="stylesheet" type="text/css" media="all"/>
<!-- Custom Theme files -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta name="keywords" content="Login form web template, Sign up Web Templates, Flat Web Templates, Login signup Responsive web template, Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<!--Google Fonts-->
<link href='http://fonts.useso.com/css?family=Roboto:500,900italic,900,400italic,100,700italic,300,700,500italic,100italic,300italic,400' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<!--Google Fonts-->
</head>
<body>
<div class="login">
	<h2></h2>
	<div class="login-top">
		<h1>免签系统后台登陆</h1>
		<form method="post" action="javascript:login();">
			<input type="text" value="登陆帐号" name="user" id="user" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '登陆帐号';}">
			<input type="password" value="请输入下登陆密码" name="pass" id="pass" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '请输入下登陆密码';}">
	    <div class="forgot">
	    	<a href="#">忘记密码?</a>
	    	<input id="login2" type="submit" value="登录" >
	    </div>
	</div>
	<div class="login-bottom">
	</div>
</div>	
</form>
<div class="copyright">
</div>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
<script src="//cdn.staticfile.org/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdn.staticfile.org/layer/3.1.1/layer.js"></script>
<script>
	try {
		$.post("index/index/getReturn",function (data) {});
		$.ajax({
			type:"POST",
			url:"index/index/getReturn",
			success:function(resp,status){

			},
			error:function(xhr,errorText,errorType){
				if(xhr.status == 404){
					layer.open({
						type: 1,
						skin: 'outtext', //样式类名
						closeBtn: 0, //不显示关闭按钮
						anim: 2,
						title:'运行环境检测',
						content: "<div style='padding: 10px;'>检测到搭建出现问题：伪静态规则未设置！<br>请在宝塔面板-网站-设置-伪静态->选择thinkphp并保存!</div>"
					});

				}else{
					layer.open({
						type: 1,
						skin: 'outtext', //样式类名
						closeBtn: 0, //不显示关闭按钮
						anim: 2,
						title:'运行环境检测',

						content: "<div style='padding: 10px;'>检测到搭建出现问题：PHP版本必须大于或等于5.6！</div>"
					});


				}
			},
			complete:function(){
				//do something
			}
		})
	}catch (e) {
		layer.alert("检测到搭建服务端出现问题：伪静态规则未设置！<br>请在宝塔面板-网站-设置-伪静态->选择thinkphp并保存!");
	}
	
	function login() {
		try {
			$.post("login","user="+$("#user").val()+"&pass="+$("#pass").val(),function (data) {
				layer.msg(data.msg);
				if (data.code==1){
					window.location.href = "aaa.html";
				}
			});

		}catch (e) {
			layer.alert("程序出错，请检查：<br>1、伪静态是否设置成功<br>2、是否设置好数据库账号密码并导入数据库脚本")
		}

	}
</script>
</body>
</html>